/*
 * 作者：贺智远
 * 功能：获奖统计的action
 * 日期：2015-06-03
 */
package admin.action.statistics;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import admin.service.member.LeaderServiceAdmin;

import teacher.bean.Teacher;
public class AwardStatisticsAction {
	 List<Map<Integer,Integer>> counts= new ArrayList<Map<Integer,Integer>>();
	
	public List<Map<Integer, Integer>> getCounts() {
		return counts;
	}

	public void setCounts(List<Map<Integer, Integer>> counts) {
		this.counts = counts;
	}

	public String execute()
	{	
		LeaderServiceAdmin ls=new LeaderServiceAdmin();
		for (int i=0;i<4;i++)
		{  
			Map map =new HashMap ();
			for(int j=1;j<5;j++)
			{
				Teacher tea=new Teacher();
				tea.setDirection(i);			
				map.put(j, ls.getCountOfAwardInclude(j,tea));
			}
			Teacher tea=new Teacher();
			tea.setDirection(i);
			map.put(5,ls.getCountOfDirectAward(tea));
			counts.add(map);
		}
			for(int i=0;i<4;i++)	
			{
				getCounts().get(i).put(0, i);
			}
	
		
		 return "succ";	
	}
}
